<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

{config_load file="shopping_cart.conf"}

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$language->getLanguage()}" dir="{$language->getDirection()}">
	<head>
		{include file=$theme->getTemplateUrl("head_common.tpl")}
		<title>{#PAGE_TITLE#}</title>
	</head>
	
	<body>
		{include file=$theme->getTemplateUrl("body_start.tpl")}
		
		<h2>{#HEADING_TITLE#}</h2>
		
		{if $cart->getProductCount() > 0}
			<form action="{$smarty.const.FILENAME_SHOPPING_CART}?action=update" method="post">
				<table>
					<thead>
						<tr>
							<th>{#TABLE_HEADING_REMOVE#}</th>
							<th>{#TABLE_HEADING_IMAGE#}</th>
							<th>{#TABLE_HEADING_PRODUCTS#}</th>
							<th>{#TABLE_HEADING_QUANTITY#}</th>
							<th>{#TABLE_HEADING_TOTAL#}</th>
						</tr>
					<thead>
					<tbody>
						{foreach item="product" from=$cart->getProducts()}
							<tr>
								<td>
									<input type="hidden" name="products_id[]" value="{$product->getId()}" />
									<input type="checkbox" name="cart_delete[]" value="{$product->getId()}" />
								</td>
								<td>
									{if $product->hasImage()}
										{html_image file=$product->getImageSrc() alt="*"}
									{else}
										{html_image file="" alt="Image not available"}
									{/if}
								</td>
								<td>
									<div class="name">{$product->getName()}</div>
									<div class="info"><a href="{$smarty.const.FILENAME_PRODUCT_INFO}?products_id={$product->getId()}">More information</a></div>
								</td>
								<td>
									<input type="text" name="cart_quantity[]" value="{$cart->getProductQuantity($product->getId())}" size="2" />
								</td>
								<td class="price">
									{$product->getPrice()}
								</td>
							</tr>
						{/foreach}
					</tbody>
				</table>
				<p>
					{#SUB_TITLE_SUB_TOTAL#}
					{$cart->getTotalAmountFormatted()}
				</p>
				<p><input type="submit" name="update_cart" value="{#TEXT_BUTTON_UPDATE#}" /></p>
			</form>
		{else}
			<p>{#TEXT_CART_EMPTY#}</p>
		{/if}
		
		{include file=$theme->getTemplateUrl("body_end.tpl")}
	</body>
</html>
